package net.eicp.nada;

public class Six {
	public static void main (String[] args) {
		Dog a = new Dog();
		Dog b = new Dog();
		a.name = "spot";
		a.says = "Ruff!";
		b.name = "spot";
		b.says = "Ruff!";
		System.out.println(a.equals(b));
		System.out.println(a == b);
		System.out.println(a.name == b.name);	//由于两个均指向同一个字符串，因此两者相等
		System.out.println(b.name.equals(b.name));
	}
}
